All Questions
19 questions
3votes
1answer
562views
SetTimeout to populate Javascript Object while a function looped AJAX requests to get data
I wrote some code that will get the name and data of a node or multiple of nodes and put them in an object (seriesData) so I can use said object for a chart (renderChart). I used setTimeout() so ...
0votes
1answer
105views
Checking if an array element exists in a JS object
I have a feature in my application that should allow users to select items in a drop down menu and move them up and down. Once they select and click on the button I have to loop over the array of ...
1vote
2answers
86views
My for-each implementation
I have implemented for-each as in jQuery, this is the code below, ...
0votes
2answers
113views
Iterating through specific elements of an array with filter()
I have the following code which iterates through some divs of an array to show() them. I was wondering if there is any way to rewrite the ...
0votes
1answer
155views
Slideshow by array using slice method
I made a slide show using array values, it works, but I strongly believe that the way I did is too long. There should be an easier or more compact way to achieve this. ...
3votes
1answer
47views
Making a selection in a dropdown based on several possible values
I'm making a Chrome extension that lets you choose a size of an item and check out quickly. I have a value called "Large" in sizePref array in my chrome.storage. ...
5votes
2answers
115views
Parsing a URL from a document and matching it from an array
I need help in improving this script that I have written to parse a URL and check it from an array. This is what I have done till now: (fiddle) This is working fine. Was this done correctly? What ...
2votes
1answer
607views
Passing an array in a hyperlink
Maybe this is fine the way it is, but it seems messy. Basically I have dynamically generated HTML that will display a list of songs in a given folder. Each song has an ID, and I want to add a button ...
0votes
1answer
2kviews
Manipulating URL/array to remove the last element
Is there a better way to do this using chaining? ...
6votes
1answer
372views
Shortening jQuery array
In short, the code picks up to 9 different ids from li in jailplayer. If a hillside, it ...
2votes
2answers
32kviews
Efficient way to iterate over elements of array for matching contents of another array
Using jQuery I'm trying to find an efficient way to iterate through an array excludeMe and check if elements from another array ...
4votes
1answer
1kviews
Making an array editable by user
What I want to do: Let users add data to an array through an input field and add button. HTML: ...
1vote
1answer
418views
Optimize jQuery code includes autocomplete function for different input box with different autocomplete content
I have this code below for autocomplete feature of several inputTextbox. The input box also share same class".wikiInput". When user typed something in either of them, a relevant autocomplete dropdown ...
1vote
2answers
268views
Same function but use different array data
I have these two carousels that randomly pick up pictures. [fiddle] Each of them picks up pictures and links from their own different inner array. It works fine as it is, but I was just wondering if ...
0votes
2answers
106views
Trying to convert an extended Array.prototype to a function
I got a random image rotator working by using the following script (demo). But I was told that it is a bad practice to extend Array.prototype. And it does. It ...